/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package MyBot.reactive;

import cz.cuni.pogamut.Client.*;
import cz.cuni.pogamut.Client.RcvMsgEvent;
import java.util.logging.Logger;


/**
 *
 * @author Ivan Medeiros Monteiro
 */
public class ReactiveLayer {
    protected ReactiveBehavior m_currentBehavior = null;

    public ReactiveLayer (AgentMemory memory, AgentBody body, GameMap gameMap , Logger log, Logger plataformLog){
        m_currentBehavior = new DummyBehavior(memory, body, gameMap, log, plataformLog);

    }

    public void prePrepareAgent() {
        if(m_currentBehavior instanceof ReactiveBehavior)
            m_currentBehavior.prePrepareAgent();
    }

    public void postPrepareAgent() {
        if(m_currentBehavior instanceof ReactiveBehavior)
            m_currentBehavior.postPrepareAgent();
    }

    public void doLogic() {
        if(m_currentBehavior instanceof ReactiveBehavior)
            m_currentBehavior.doLogic();
    }

    public void receiveMessage(RcvMsgEvent e){
        if(m_currentBehavior instanceof ReactiveBehavior)
            m_currentBehavior.receiveMessage(e);
    }
}
